package cn.changgou.goods.feign;

import cn.changgou.entity.Result;
import cn.changgou.goods.pojo.Sku;
import cn.changgou.order.pojo.OrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "goods")
@RequestMapping("/sku")
public interface SkuFeign {

    /*商品信息递减*/
    @PostMapping(value = "/decr/count")
    public Result decrCount(@RequestBody OrderItem orderItem);

    /*根据ID查询Sku数据*/
    @GetMapping("/{id}")
    Result<Sku> findById(@PathVariable Long id);

    /*查询Sku全部数据*/
    @GetMapping
    Result<List<Sku>> findAll();

    /*根据条件搜索*/
    @PostMapping(value = "/search")
    public Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);
}
